python连接redis

1.python连接redis

from django.test import TestCase
import redis
conn
= redis.Redis(host='127.0.0.1') conn.set('key1', 'v1') conn.hset('n2', 'k2', 'v2') print(conn.get('key1'))

 

 

posted @ 2019-07-14 17:44  顽强的allin  阅读(292)  评论(0编辑  收藏  举报